<% include ./common/header.ejs %>
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-md-3 col-sm-3 col-xs-3 left_box">
                <div class="user_info">
                    <div><img src="/images/index/head.jpg" alt=""></div>
                    <p class="name">yuonly</p>
                    <p>5494785775@qq.com</p>
                </div>

                <ul class="category">
                
                    <li <%if(cid==0){ %> class="active" <%}%>>
                        <a href="/"><i class="icon-home"></i>首页</a>
                    </li>
                    <% for(var i=0;i<category.length;i++){ %>
                    <li <%if(cid==category[i].cid){%> class="active"  <%}%> >
                        <a href="/category?cid=<%=category[i].cid%>">
                            <i class="icon-reorder"></i><%=category[i].cname%>
                        </a>
                    </li>
                    <% } %>
                </ul>
            </div>
            <div class="col-md-9 col-sm-9 col-xs-9 right_box">
                <div class="header">
                    yu blog
                </div>
                <div class="content">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div class="page-header">
                                <h1><%=article.title%></h1>
                                <div class="info">
                                    <span class="author">作者: <%=article.author%></span> 
                                    <span class="time">发布时间:<%= moment(article.time).format('YYYY/MM/DD HH:mm:ss') %></span>  
                                    <span>阅读:<%=article.click%></span>
                                </div>
                            </div>
                            <div style="border-bottom: 1px solid gray">
                                <%-article.content%>
                            </div>
                            <div class="coment_title">
                                评论
                            </div>
                            <form action="/coment" method="post">
                                <textarea class="form-control" name="content" id="" cols="30" rows="3"></textarea>
                                <input type="hidden" name="aid" value="<%=aid%>">
                                <input type="submit" class="btn btn-success" value="评论">
                            </form>

                            <ul style="border:1px solid red;">
                                <% for(var k=0;k<coment.length;k++){ %>
                                <li>
                                    <div class="title">
                                            <%= moment(coment[k].time).format('YYYY/MM/DD HH:mm:ss') %>
                                    </div>
                                    <div class="body">
                                        <%=coment[k].content%>
                                    </div>
                                </li>
                                <% } %>
                            </ul>
                            
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>

<% include ./common/footer.ejs %>